package cn.icanci.loopstack.bic.web.controller;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.icanci.loopstack.bic.biz.service.GraphService;
import cn.icanci.loopstack.bic.common.result.R;
import cn.icanci.loopstack.bic.web.model.Graph;

/**
 * 返回单元纠察图数据
 * 
 * @author icanci
 * @since 1.0 Created in 2023/09/23 22:58
 */
@RestController
@RequestMapping("/bicAdmin/graph")
public class GraphController {
    @Resource
    private GraphService graphService;

    @PostMapping("load")
    public R load(@RequestBody Graph graph) {
        return R.builderOk().data("graph", graphService.buildOneGraph(graph.getSystemUuid(), graph.getUseCaseUuid(), graph.getTraceId(), graph.getOrderSerialNo())).build();
    }
}
